<!DOCTYPE html>
<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
        <meta http-equiv="X-UA-Compatible" content="IE=EmulateIE9" />
        <title>Python快速开发框架</title>
        <link href="/Content/Images/favicon.ico" rel="shortcut icon" type="image/x-icon" />
        <link href="/Content/Scripts/showloading/showLoading.css" rel="stylesheet" type="text/css" />
        <link href="/Content/Styles/common.css" rel="stylesheet" type="text/css" /> 
        <link href="/Content/Scripts/easyui/themes/{{ Skin }}/easyui.css" rel="stylesheet" type="text/css" />
        <link href="/Content/Styles/iconNew16.css" rel="stylesheet" type="text/css" />
        <script type="text/javascript" src="/Content/Scripts/jquery-1.8.3.min.js"></script>   
        <script type="text/javascript" src="/Content/Scripts/easyui/jquery.easyui.min.js"></script> 
        <script type="text/javascript" src="/Content/Scripts/easyui/locale/easyui-lang-zh_CN.js"></script>
        <script type="text/javascript" src="/Content/Scripts/jQuery.Ajax.js"></script>
        <script type="text/javascript" src="/Content/Scripts/easyui/hpwf-easyui-extend.js?v=30" ></script>
        <script type="text/javascript" src="/Content/Scripts/hpwf-core.js?v=30" ></script>
        <script type="text/javascript" src="/Content/Scripts/jsCommon.js?v=30" ></script>
        <script type="text/javascript" src="/Content/Scripts/jQuery.cookie.js" ></script>
        <script type="text/javascript" src="/Content/Scripts/csrf.js"></script>
        <script type="text/javascript" src="/Content/Scripts/clearcookie.js"></script>
    </head>
<body class="easyui-layout" style="overflow-y: hidden;" fit="true" scroll="no" oncontextmenu="return false" ondragstart="return false" oncopy="document.selection.empty()" onbeforecopy="return false">
    <div id="loading" style="position: fixed;top: -50%;left: -50%;width: 200%;height: 200%;background: #fff;z-index: 100;overflow: hidden;">
        <img src="/Content/Images/ajax-loader.gif" style="position: absolute;top: 0;left: 0;right: 0;bottom: 0;margin: auto;" />
    </div>

    <noscript>
        <div style=" position:absolute; z-index:100000; height:2046px;top:0px;left:0px; width:100%; background:white; text-align:center;">
            <img src="/Content/Images/noscript.gif" alt='抱歉，请开启脚本支持！' />
        </div>
    </noscript>

    <div id="northPanel" data-options="region: 'north', border: false" style="height: 103px; overflow: hidden;">
        <div id="topbar" class="top-bar headbackcss">
            <div class="top-bar-left">
                <h2>Python快速开发框架</h2>
            </div>
            <div class="top-bar-right">
                <div id="timerSpan"></div>
            </div>
        </div>
        <div id="toolbar" class="panel-header panel-header-noborder top-toolbar">
            <div id="infobar">
                <span class="icon16_administrator" style="padding-left: 25px; background-position: left center;">
                    欢迎 <b id="curname">{{ Account }}</b>
                </span>
            </div>
            <div id="buttonbar">
                
                <a id="editPass" class="easyui-linkbutton" data-options="plain: true, iconCls: 'icon16_user_level_filtering'">修改密码</a>
                <a id="loginOut" class="easyui-linkbutton" data-options="plain: true, iconCls: 'icon16_door_out'">退出系统</a>
                <a id="btnShowNorth" class="easyui-linkbutton" data-options="plain: true, iconCls: 'layout-button-down'" style="display: none;"></a>
            </div>
        </div>
    </div>
    <div region="west" split="true" title="导航菜单" style="width: 200px;" id="west">
        <div id="wnav">
            <!--  手风琴导航内容 -->
        </div>
    </div>
    <div region="south" split="true" style="height: 30px;">
        <div class="footer">Copyright &copy; hpwf V1.0, All Rights Reserved</div>
    </div>

    <div id="mainPanle" region="center" style="background: #eee; overflow-y:hidden" border="false">
        <div id="tabs" class="easyui-tabs" fit="true"></div>
    </div>

    <div id="closeMenu" class="easyui-menu" style="width:150px;">
        <div id="refresh" iconcls="icon16_refresh_all">刷新</div>
        <div class="menu-sep"></div>
        <div id="close">关闭</div>
        <div id="closeall">全部关闭</div>
        <div id="closeother">除此之外全部关闭</div>
        <div class="menu-sep"></div>
        <div id="closeright">关闭右侧窗口</div>
        <div id="closeleft">关闭左侧窗口</div>
        <div class="menu-sep"></div>
        <div id="exit">退出</div>
    </div>

    <div id="w"></div><div id="i"></div><div id="d"></div>

    <!--载进度条start-->
    <div id="loading_background" class="loading_background" style="display: none;"></div>
    <div id="loading" onclick="Loading(false);">
        <img src="/Content/Images/loading.gif" style="vertical-align: middle;" />&nbsp;<span>正在拼了命为您加载…</span>&nbsp;
    </div>
    <div id="loadingGird">
        <img src="/Content/Images/loading.gif" style="vertical-align: middle;" />&nbsp;正在拼了命为您加载…&nbsp;
    </div>
    <script type="text/javascript">
        $(function () {
            $('#loginOut').click(function () {
                $.messager.confirm('系统提示', '您确定要退出本次登录吗?', function (r) {
                    if (r) {
                        window.setTimeout(function () {
                            getAjax("/Admin/OutLogin/", "", function (data) {
                                window.location.href = '/Admin/Index/';
                            })
                        }, 200);
                    }
                });
            });

            $(window).load(function () {
                $('#loading').fadeOut();
            });
        });

        function checkLeave(){
            event.returnValue = "确定离开当前页面吗？您还没有退出登录！"
        }

        var lastTime = new Date().getTime();
        var currentTime = new Date().getTime();
        var timeOut = 30 * 60 * 1000;
        $(document).ready(function(){
            /* 鼠标移动事件 */
            $(document).mousemove(function(){
                lastTime = new Date().getTime(); //更新操作时间
            });
        });
        function testTime(){
            currentTime = new Date().getTime(); //更新当前时间
            if(currentTime - lastTime > timeOut){ //判断是否超时
                console.log("超时")
                clearCookie();
                window.location.href = '/Admin/Index/';
            }
        }
        window.setInterval(testTime, 10000);


    </script>
    <script type="text/javascript" src="/Content/Scripts/layer/layer.js"></script>
    <script type="text/javascript" src="/Content/Scripts/hpwf-index.js?v=30"></script>
    <script type="text/javascript" src="/Content/Scripts/qqmsg/jQuery.qqmsg.js"></script>
    <script type="text/javascript" src="/Content/Scripts/showloading/jquery.showLoading.min.js"></script>
    <script type="text/javascript" src="/Content/Scripts/easyui/jquery.validate.min.js"></script>
    <script type="text/javascript" src="/Content/Scripts/easyui/jquery.validate.messages_zh.js"></script>

    <script type="text/javascript">
        /**初始化**/
        $(document).ready(function () {
            var errorUrl = '/error/error404';
            addTab("我的桌面", '/Admin/StartPage', "icon16_home_page");
            loadMenu();
        });

        function loadMenu() {
            var postData = {
                csrfmiddlewaretoken: '{{ csrf_token }}'
            };
            $.ajaxjson('/Admin/LoadTreeMenu/', postData, function (data) {
                var treeJson = data;
                $.each(treeJson, function (i, n) {
                    var cssIcon = 'icon icon-application_osx'; //没有设置图标，则取一个默认图标
                    if (n.iconCls) {
                        cssIcon = n.iconCls;
                    }

                    $('#wnav').append('<div style="padding:0px;" title="' + n.text
                                + '" data-options="border:false,iconCls:\''
                                + cssIcon
                                + '\'"><ul id="nt'
                                + i
                                + '"></ul></div>');
                });

                $("#wnav").accordion({
                    fit: true,
                    border: false,
                    onSelect: function (t, i) {
                        $('#nt' + i).tree({
                            lines: false,
                            animate: true,
                            data: treeJson[i].children,
                            onClick: function (node) {
                                if (node.attributes.url != "" && node.attributes.url != '#') {
                                    addTab(node.text, node.attributes.url, node.iconCls);
                                } else {
                                    if (node.attributes.url != '#') {
                                        addTab(node.text, errorUrl, node.iconCls);
                                    }
                                }
                            }
                        });
                    }
                });
            });
        }

    </script>
</body>
    
</html>